#ifndef ITEMENUM_H
#define ITEMENUM_H

#include <QMetaEnum>
#include "config/ConfigItem.h"


class ItemEnum : public ConfigItem {
    Q_OBJECT
public:
    int get();
    void set(const int &value);

    QMetaEnum getMetaEnum();
    void  setMetaEnum(const QMetaEnum &e);
protected:
    QWidget *createWidget(WidgetStyle s) override;
    void update(QWidget *widget, UpdateOption option) override;
    void writeToData(QDataStream &stream) const override;
    void readFromData(QDataStream &stream) override;

private:
    int m_data = 0;
    QMetaEnum m_enum;
    QWidget *createRadioButtonGroup();
    QWidget *createComboBox();
    QWidget *createComboBoxCompleted();
    void updateRadioButtonGroup(QWidget *widget, UpdateOption option);
    void updateComboBox(QWidget *widget, UpdateOption option);

};

#endif // ITEMENUM_H
